const tokenKEY = 'hm-mobile-70-token'
const historyKEY = 'hm-mobile-70-history'

// 存储token
export const setToken = (tokenObj) => {
  localStorage.setItem(tokenKEY, JSON.stringify(tokenObj))
}

// 获取token
export const getToken = () => {
  return JSON.parse(localStorage.getItem(tokenKEY)) || {}
}

// 删除token
export const removeToken = () => {
  localStorage.removeItem(tokenKEY)
}

// 获取history
export const getHistory = () => {
  return JSON.parse(localStorage.getItem(historyKEY)) || []
}

// 设置history
export const setHistory = (arr) => {
  localStorage.setItem(historyKEY, JSON.stringify(arr))
}
